package com.hllxd.hism.star.basic.service.constant.alarm;

/**
 * @description 维度配置类型枚举
 * @auhtor wuguangxi
 * @date 2022/2/10 15:19
 **/
public enum ConfigTypeEnum {

    ALL("all", "all"),
    ITEM("item", "item"),
    GROUP("group", "group");

    private final String name;

    private final String code;

    ConfigTypeEnum(String name, String code){
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static ConfigTypeEnum getByCode(String code){
        for(ConfigTypeEnum configTypeEnum : ConfigTypeEnum.values()){
            if(configTypeEnum.getCode().equals(code)){
                return configTypeEnum;
            }
        }
        return null;
    }
}
